<!DOCTYPE HTML>
<html>
<head>
    <title>Getting Started Sample</title>
    <meta charset="UTF-8">

	<link type="text/css" rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
	<link type="text/css" rel="stylesheet" href="//cdn.jsdelivr.net/npm/alpaca@$ALPACA_VERSION/dist/alpaca/bootstrap/alpaca.min.css">

	<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/handlebars.js/4.0.5/handlebars.js"></script>
	<script type="text/javascript" src="http://cdn.jsdelivr.net/npm/alpaca@$ALPACA_VERSION/dist/alpaca/bootstrap/alpaca.min.js"></script>

</head>
<body>
    
    <div class="container" style="margin-top:30px">
        <div class="row">
            <div class="col-md-12">
                <div id="field1"></div>
            </div>
        </div>
    </div>

<script type="text/javascript">
$(document).ready(function() {
    $("#field1").alpaca({
        "schema": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "title": "Name"
                },
                "age": {
                    "type": "number",
                    "title": "Age"
                }                
            }
        },
        "data": {
            "name": "Joe Smith",
            "age": 35
        }

        /** add in this section to experiment with a form button */
        /*
        ,"options": {
            "form": {
                "buttons": {
                    "submit": {
                        "title": "Submit",
                        "click": function() {
                            alert("Form value is: " + JSON.stringify(this.getValue(), null, "  "));
                        }
                    }
                }
            }
        }
        */

        /** add in this section to receive the callback after the form renders **/
        /*
        ,"postRender": function(control)
        {
            control.childrenByPropertyId["age"].options.label = "How old are you?";
            control.childrenByPropertyId["age"].refresh();            
        }
        */
    });
});
</script>
	
</body>

</html>



